#include "myhttpd.h"

int myrecv(int socket,char *buffer,int len,int flags)
{
  int result;

  result = recv(socket, buffer, len, flags);
  if (result == -1)
  {
    write(1, "utility.c : Erreur de lecture de la socket.\n", 44);
    exit(EXIT_FAILURE);
  }
    //retirer client de la liste des clients et du fd_set

  return (result);
}

int myaccept(int socket, struct sockaddr *addr, socklen_t *len)
{
  int new_socket;

  new_socket = accept(socket, addr, len);
  if (new_socket == -1)
  {
    write(1, "get_message.c : Erreur lors de accept().\n", 41);
    exit(EXIT_FAILURE);
  }

  return (new_socket);
}
